﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace 窗体学习
{
    class Program
    {
        static Form f = new Form();//窗体
        [STAThread]
        static void Main(string[] args)
        {

            Button b = new Button();//按钮
            b.Text = "button";//按钮文本
            f.Controls.Add(b);//为窗体添加按钮
            f.StartPosition = FormStartPosition.CenterScreen;
            f.Size = new Size(400,500);
            Thread t = new Thread(Test);
            t.IsBackground = true;
            t.Start();
            Console.ReadKey();
        }
        public static void Test()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(f);
        }
    }
}
